package com.quanxiaoha.xiaohashu.user.biz.rpc;


import com.quanxiaoha.framework.common.response.Response;
import com.quanxiaoha.xiaohashu.oss.api.FileFeignApi;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: jingyan_liu
 * @CreateTime: 2025-07-22
 * @Description:
 * @Version: 1.0
 */

@Component
public class OssRpcService {
	
	@Resource
	private FileFeignApi fileFeignApi;
	
	public String uploadFile(MultipartFile file) {
		// 调用对象存储服务上传文件
		Response<?> response = fileFeignApi.uploadFile(file);
		return response.isSuccess() ? (String) response.getData() : null;
	}
}